package com.hybrid.jsbridge;

import android.text.TextUtils;
import com.hybrid.webview.WVWebView;

/**
 * 在此写用途
 *
 * @author: zhiwei
 * @date: 2017-10-09 22:34
 * @version: 9.1.0
 */
public class WVPageFinishJSRender {
    private static boolean renderJs=false;

    private static String jsContent=null;

    public static void renderJSContent(final WVWebView mWebView){
        if(renderJs&& !TextUtils.isEmpty(jsContent)){
            //执行js
            mWebView.evaluateJavascript(jsContent);
        }
    }
    public static void setJsContent(String js){

        if(!TextUtils.isEmpty(js)){
            renderJs=true;
            jsContent=js;
        }
    }
    public static void clearJsRender(){
        renderJs=false;
        jsContent=null;
    }
    public static boolean isRenderJs(){
        return renderJs;
    }
}
